﻿using Nop.Core.Domain.Messages;
using Nop.Plugin.Misc.MessageDesigner.Domain;
using Nop.Plugin.Misc.MessageDesigner.Models;
using System.Collections.Generic;

namespace Nop.Plugin.Misc.MessageDesigner.Services
{
    /// <summary>
    /// Message design service
    /// </summary>
    public partial interface IMessageDesignerService
    {
        /// <summary>
        /// Delete a message design
        /// </summary>
        /// <param name="messageDesign">Message design</param>
        void DeleteMessageDesign(MessageDesign messageDesign);

        /// <summary>
        /// Inserts a message design
        /// </summary>
        /// <param name="messageDesign">Message design</param>
        void InsertMessageDesign(MessageDesign messageDesign);

        /// <summary>
        /// Updates a message design
        /// </summary>
        /// <param name="messageDesign">Message design</param>
        void UpdateMessageDesign(MessageDesign messageDesign);

        /// <summary>
        /// Gets a message design by identifier
        /// </summary>
        /// <param name="messageDesignId">Message design identifier</param>
        /// <returns>Message design</returns>
        MessageDesign GetMessageDesignById(int messageDesignId);

        /// <summary>
        /// Gets a message design by name
        /// </summary>
        /// <param name="messageDesignName">Message design name</param>
        /// <param name="storeId">Store identifier</param>
        /// <returns>Message design</returns>
        MessageDesign GetMessageDesignByName(string messageDesignName, int storeId);

        /// <summary>
        /// Gets all message designs
        /// </summary>
        /// <param name="storeId">Store identifier; pass 0 to load all records</param>
        /// <returns>Message design list</returns>
        IList<MessageDesign> GetAllMessageDesigns(int storeId);

        /// <summary>
        /// merge of message design with template
        /// </summary>
        /// <param name="messageDesign">Message design</param>
        /// <returns>Message design copy</returns>
        ResultsModel MergeMessageDesign(MessageDesign messageDesign, MessageTemplate messageTemplate);

         /// <summary>
        /// remove of message design from template
        /// </summary>
        /// <returns>Message design copy</returns>
        void RemoveAllDesigns();

        /// <summary>
        /// remove of message design from template
        /// </summary>
        /// <param name="messageDesign">Message design</param>
        /// <returns>Message design copy</returns>
        ResultsModel RemoveMessageDesign(MessageTemplate messageTemplate);

        /// <summary>
        /// Get message templates by identifiers
        /// </summary>
        /// <param name="messageTemapleIds">messageTemplate identifiers</param>
        /// <returns>MessageTemplates</returns>
        IList<MessageTemplate> GetMessageTemplatesByIds(int[] messageTemplatIds);

        ResultsModel MergeDesginTemplate(ResultsModel resultModel, string langName, string bodyDesign, string bodyTemplate);
        DesignResultsModel IsMessageDesignerContent(string body);
        DesignResultsModel IsMessageDesignerId(string body);
        void ExecuteSQL(string fileName);
    }
}
